#ifndef CNSCENE_H
#define CNSCENE_H

#include <QGraphicsScene>

class CNScene : public QGraphicsScene
{
    Q_OBJECT
public:
    explicit CNScene(QObject *parent = nullptr);

protected:
    void drawBackground(QPainter *painter, const QRectF &rect) override;
    void dropEvent(QGraphicsSceneDragDropEvent *event) override;
    void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
    void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;

private:
    bool m_bConnecting = false;

    QGraphicsLineItem *m_pLineItem = nullptr;


private:
    QJsonObject serializeScene();

public slots:
    void onSaveFile();
};

#endif // CNSCENE_H
